<?php
/**
* @file $Id: RequestsReport.php 21 2006-07-02 23:18:06Z focus-sis $
* @package Focus/SIS
* @copyright Copyright (C) 2006 Andrew Schmadeke. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.txt
* Focus/SIS is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.txt for copyright notices and details.
*/

	$sections_RET = DBGet(DBQuery("SELECT cs.TITLE as SUBJECT_TITLE,c.TITLE||' - '||cp.COURSE_WEIGHT AS COURSE,cp.COURSE_ID,cp.COURSE_WEIGHT,cp.PERIOD_ID,cp.TEACHER_ID,cp.ROOM,cp.TOTAL_SEATS AS SEATS,cp.MARKING_PERIOD_ID FROM COURSE_PERIODS cp,COURSES c,COURSE_SUBJECTS cs WHERE cs.SUBJECT_ID=c.SUBJECT_ID AND cp.COURSE_ID=c.COURSE_ID AND cp.SYEAR='".UserSyear()."' AND cp.SCHOOL_ID='".UserSchool()."'"),array('PERIOD_ID'=>'GetPeriod','TEACHER_ID'=>'GetTeacher','MARKING_PERIOD_ID'=>'_makeMP'),array('COURSE'));
	$columns = array('SUBJECT_TITLE'=>_('Subject'),'COURSE'=>_('Course'),'PERIOD_ID'=>_('Period'),'TEACHER_ID'=>_('Teacher'),'ROOM'=>_('Room'),'SEATS'=>_('Seats'),'MARKING_PERIOD_ID'=>_('Marking Period'));
	
	DrawHeader(ProgramTitle());
	ListOutput($sections_RET,$columns,'','',array(),array(array('COURSE','SUBJECT_TITLE')));
	
	function _makeMP($marking_period_id,$column)
	{
		if(!$mp_title = GetMP($marking_period_id,'TITLE'))
			$mp_title = $marking_period_id;
		return $mp_title;
	}
?>